package com.cube.truthseer.entity.video.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.cube.truthseer.common.exception.BadRequestException;
import com.cube.truthseer.entity.picture.enums.PictureVisableStatus;
import com.cube.truthseer.entity.user.constants.UserErrorInfo;

public enum VideoFlagStatus {
    FROZEN(1, "不可见"),
    NORMAL(0, "可见"),
    ;
    @EnumValue
    int value;
    String desc;

    VideoFlagStatus(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static VideoFlagStatus of(int value) {
        if (value == 0) {
            return NORMAL;
        }
        if (value == 1) {
            return FROZEN;
        }
        throw new BadRequestException(UserErrorInfo.Msg.INVALID_USER_STATUS);
    }
}
